<% unless flash.blank? %>
    <% flash.each do |name, msg| %>
        <div class="alert alert-<%= name.to_s=="notice"? "success": "error" %>">
          <button type="button" class="close" data-dismiss="alert">×</button>
          <% if msg.class!=String %>
              <% msg.each do |m| %>
                  <p><%=m %></p>
                  <script type="text/javascript">
                      $(function(){
                          $.pnotify({
                              title: '<%= t"general.#{name}" %>',
                              text: '<%=m %>',
                              type: '<%= name.to_s=="notice"? "success": "error" %>',
                              icon: 'icon-eye-open',
                              shadow: false,
                              delay: '1000'
                          });
                      });
                  </script>
              <% end %>
          <% else %>
              <p><%=msg %></p>
              <script type="text/javascript">
                  $(function(){
                      $.pnotify({
                          title: '<%= t"general.#{name}" %>',
                          text: '<%=msg %>',
                          type: '<%= name.to_s=="notice"? "success": "error" %>',
                          icon: 'icon-eye-open',
                          shadow: false,
                          delay: '1000'
                      });
                  });
              </script>
          <% end %>
        </div>
    <% end %>
<% end %>